﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class IndexScript : MonoBehaviour {

	void Start () {
		GameObject go = Instantiate (Resources.Load ("AudioManager")) as GameObject;
		DontDestroyOnLoad (go);
		AudioManager.instance.PlayBGaudio (Random.value > 0.5 ? "animation1" : "animation2");
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public void StartButton(){
		AudioManager.instance.StopAllAudio ();
		SceneManager.LoadScene ("map");
	}

	public void QuitButton(){
		Application.Quit ();
	}

	public void ToEditor(){
		SceneManager.LoadScene ("Editor");
	}
}
